/*
 * @Author: Marshall
 * @Date: 2024-06-02 21:03:51
 * @LastEditors: Marshall
 * @LastEditTime: 2024-06-09 00:51:09
 * @Description:
 * @FilePath: /yudao-ui-admin-vue3/src/api/road/trip/index.ts
 */
import request from '@/config/axios'

// 线路 VO
export interface TripVO {
  id: number // 自增主键
  name: string // 线路名称
  description: string // 线路描述
  deptId: number // 线路部门id
}

// 线路 API
export const TripApi = {
  // 查询线路分页
  getTripPage: async (data: any) => {
    return await request.post({ url: `/scenic/trip/trip_page_by_location`, data })
  },

  // 查询线路详情
  getTrip: async (id: number) => {
    return await request.get({ url: `/scenic/trip/get?id=` + id })
  },

  // 新增线路
  createTrip: async (data: TripVO) => {
    return await request.post({ url: `/scenic/trip/create`, data })
  },

  // 修改线路
  updateTrip: async (data: TripVO) => {
    return await request.put({ url: `/scenic/trip/update`, data })
  },

  // 删除线路
  deleteTrip: async (id: number) => {
    return await request.delete({ url: `/scenic/trip/delete?id=` + id })
  },

  // 导出线路 Excel
  exportTrip: async (params) => {
    return await request.download({ url: `/scenic/trip/export-excel`, params })
  }
}
